package cn.pugle.oj.leetcode;

import cn.pugle.oj.catalog.BitProblem;
import cn.pugle.oj.catalog.Unknown;

/**
 * https://leetcode.com/problems/single-number/
 * every element appears twice except for one
 * 136 137 260
 *
 * @author tzp
 * @since 2020/11/13
 */
public class LC136 implements BitProblem {

    public int singleNumber(int[] nums) {
        int a = 0;
        for (int i : nums) {
            a ^= i;
        }
        return a;
    }

    public static void main(String[] args) {
        System.out.println(new LC136());
    }
}
